#pragma once

#include "IView.h"

#include <libtcod/libtcod.hpp>
#include <memory>

namespace Views
{

class GameView : public IView
{
public:
	GameView(const ViewContent &content, TCODConsole *parent);
	virtual ~GameView();

	void update(float dt) override;
	void render() override;

public:
	bool inputKeyDown(TCOD_key_t &key, TCOD_mouse_t &mouse) override;
	bool inputKeyUp(TCOD_key_t &key, TCOD_mouse_t &mouse) override;
	bool motion(TCOD_key_t &key, TCOD_mouse_t &mouse) override;
	bool mousePressed(TCOD_key_t &key, TCOD_mouse_t &mouse) override;
	bool mouseReleased(TCOD_key_t &key, TCOD_mouse_t &mouse) override;

private:
	void init(const ViewContent &content);

	TCODConsole *parent;
	glm::ivec2 viewport;
	glm::ivec2 position;
	glm::vec2 alpha;
	unsigned int alignment;

	std::unique_ptr<TCODConsole> console;
};

}

